﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Area
{
    class Program
    {
        static void Main(string[] args)
        {
            Dowhile();
        }
        public static void Dowhile(){
            Console.WriteLine("请选择你要计算的图形：1.圆形，2.长方形");
            int key = Convert.ToInt32(Console.ReadLine());
            Shape shape ;
            switch (key)
            {
                case 1:
                    Console.WriteLine("请输入圆的半径：");
                    double R = Convert.ToDouble(Console.ReadLine());
                    shape = new Circle(R);
                    shape.color = "该圆的颜色是黄色";
                    break;
                case 2:
                    Console.WriteLine("请输入长方形的长：");
                    double A = Convert.ToDouble(Console.ReadLine());
                    Console.WriteLine("请输入长方形的宽：");
                    double B = Convert.ToDouble(Console.ReadLine());
                    shape = new Square(A, B);
                    shape.color = "该长方形的颜色是蓝色";
                    break;
                default:
                    Console.WriteLine("你不想算就直接说！！！,再重新输一次！！！");
                    Dowhile();
                    shape = new Circle(0);
                    break;
            }
            PublicArea publicArea = new PublicArea();
            publicArea.PublicAreatest(shape);
        } 
    }
}
